﻿@model IList<CTM.Web.Models.View.Report.ReportItemViewModel>

@{
    WebGrid gridC = new WebGrid(source: Model, canSort: true, rowsPerPage: (int)ViewBag.PageSize, ajaxUpdateContainerId: "conversation-result", fieldNamePrefix: "cf_", pageFieldName: "cp_");
}

@(new HtmlString(
    gridC.GetHtml(tableStyle: "table",
                headerStyle: "webgrid-header",
                mode: WebGridPagerModes.All,
                columns: gridC.Columns(gridC.Column(header: "No", style: "text-right", format: item => item.WebGrid.Rows.IndexOf(item) + 1 + Math.Round(Convert.ToDouble(gridC.TotalRowCount / gridC.PageCount) / gridC.RowsPerPage) * gridC.RowsPerPage * gridC.PageIndex),
                        gridC.Column("Associate", format: @<text>@Html.ActionLink((string)item.Associate, "Index", "Conversation", new { id = item.AssociateId }, null)</text>),
                        gridC.Column("NoMyPost", "My conversations", style: "text-right"),
                        gridC.Column("NoOtherPost", "Other's conversations", style: "text-right"),
                        gridC.Column("NoSmilePost", "{SmileHeading}", style: "text-right"),
                        gridC.Column("NoFrownPost", "{FrownHeading}", style: "text-right"),
                        gridC.Column("NoNeutralPost", "{NeutralHeading}", style: "text-right"),
                        gridC.Column("NoGoalsPost", "Goals", style: "text-right"),
                        gridC.Column("NoCareerPost", "Career", style: "text-right"),
                        gridC.Column("NoIndividualPost", "Individual", style: "text-right"))).ToHtmlString()
                        .Replace("{SmileHeading}", "<span class='label label-success'><span class='fa fa-lg fa-smile-o'></span></span>")
                        .Replace("{FrownHeading}", "<span class='label label-danger'><span class='fa fa-lg fa-frown-o'></span></span>")
                        .Replace("{NeutralHeading}", "<span class='label label-warning'><span class='fa fa-lg fa-meh-o'></span></span>")
                        ))